package chatGUI;

import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;

/**
 * @author Michael & Pierre
 */
/**
 * List Listener to be called when a contact is selected in the user list
 */
public class ListListener implements ListSelectionListener {

	/**
	 * To keep track of the calling platform-specific GUI
	 */
	private JavaGUI gui;
	
	/**
	 * Constructor to memorize the calling platform-specific GUI's address
	 * @param ihm
	 */
	public ListListener(JavaGUI ihm) {
		this.gui = ihm;
	}
	
	/**
	 * Forwards the correct tab selection to the platform-specific GUI
	 * @param arg0
	 */
	@Override
	public void valueChanged(ListSelectionEvent arg0) {
		gui.selectTab();
	}

}
